import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

// 全局引入Element-ui 组件
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'; 
Vue.use(ElementUI);


// 全局引入axios创建的http
import http from "./http/request.js"
Vue.prototype.$http = http

Vue.prototype.$target=process.env.VUE_APP_ASSETS_URL


Vue.prototype.$globalData = {
  $categoryArr : []
}

// 注册全局登录组件
import Login from "./components/Login";
Vue.component('Login',Login)


Vue.config.productionTip = false


// 注册全局组件
import GoodsList from "./components/GoodsList";
Vue.component("goodsList",GoodsList)

Vue.prototype.$notifyError = function (msg){
  ElementUI.Notification({
      title: '错误',
      message: msg,
      type: 'error'
  })
};
Vue.prototype.$notifySuccess = function (msg){
  ElementUI.Notification({
      title: '成功',
      message: msg,
      type: 'success'
  })
};

// console.log(ElementUI);


new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
